let str='😊🤣😍😂';
String.prototype.pointLength=function(){
    let len=0;
    for(let i=0;i<this.length;){
        const codePoint=this.codePointAt(i);
        i+=codePoint>65535?2:1
        len++;
    }
    return len;
}
String.prototype.pointAt=function(index){
    let curIndex=0;
    for(let i=0;i<this.length;){
        const codePoint=this.codePointAt(i);
        if(curIndex===index){
            return String.fromCodePoint(codePoint);
        }
        i+=codePoint>65535?2:1
        curIndex++;
    }
}
String.prototype.slicePoint=function(start=0,end=this.pointLength()){
    let result='';
    for(let i=start;i<end;i++){
        result+=this.pointAt(i);
    }
    return result;
}
console.log(str.pointLength())
console.log(str.pointAt(1))
console.log(str.slicePoint(1,3));